﻿CREATE PROCEDURE [util].[GetDefaultDataPath]
@DefaultData NVARCHAR (256) OUTPUT
AS
BEGIN
	DECLARE @RC int
	SET @RC = 0
	
	EXEC @RC = master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE'
		,N'Software\Microsoft\MSSQLServer\MSSQLServer'
		,N'DefaultData'
		,@DefaultData OUTPUT
	
	IF(@DefaultData IS NULL)
	BEGIN
		RAISERROR('Unable to retrieve DefaultData registry string value',16,1)
	END
	
	RETURN(@RC)
END